package part1.language_basis.day07.day07test;

/** 求2-100之间的质数 */
public class PrimeNumber {

    public static void main(String[] args) {
        for (int i = 2; i <= 100; i++) {
            boolean flag = true;
            for (int j = 2; j <=i/2 ; j++) {
                if (i%j==0){
                    flag = false;
                    break;
                }
            }
            if (flag){
                System.out.print(i+"\t");
            }
        }

        System.out.println();

        for (int i = 2; i <= 100; i++) {
            int count = 0;
            for (int j = 2; j <= i/2; j++) {
                if (i%j==0){
                    count++;
                }
            }
            if (count==0){
                System.out.print(i+"\t");
            }
        }
    }
}
